﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DomainModel;

namespace WebPlatform.Areas.CPP.Models
{
    public class RegisterVM
    {
        /// <summary>
        /// 登录名
        /// </summary>
        [Required(ErrorMessage = "登录名 必填（4-16个字符）")]
        [StringLength(16, ErrorMessage = "登录名 4-16个字符", MinimumLength = 4)]
        [Remote("HasAccount", "Default", HttpMethod = "POST", ErrorMessage = "登录名不可用")]
        public string LoginName { get; set; }


        /// <summary>
        /// 登录密码
        /// </summary>
        [Required(ErrorMessage = "密码 必填（6-16个字符）")]
        [StringLength(16, ErrorMessage = "密码 6-16个字符", MinimumLength = 6)]
        public string LoginPassword { get; set; }


        /// <summary>
        /// 确认密码
        /// </summary>
        [Required(ErrorMessage = "确认密码 必填（6-16个字符）")]
        [StringLength(16, ErrorMessage = "确认密码 6-16个字符", MinimumLength = 6)]
        [Remote("IsSamePassword", "Default", AdditionalFields = "LoginPassword", HttpMethod = "POST", ErrorMessage = "确认密码不一致")]
        public string ConfirmLoginPassword { get; set; }

        [DisplayName("企业名")]
        [Required(ErrorMessage = "企业名 必填（100个字符以内）")]
        [StringLength(100, ErrorMessage = "企业名 不超过100个字符")]
        public string CompanyName { get; set; }


        [DisplayName("Email")]
        [Required(ErrorMessage = "Email 必填")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

    }
}